package com.tiany.java_study;

public class UserTest {
    public static void main(String[] ags) {
        User user = new User();
        user.eat();
        user.age = 18;
        user.name = "lll";
        user.isMale = true;
        user.talk("chinese");
    }

}

class User {
    String name;
    int age;
    boolean isMale;

    public void talk(String language) {
        System.out.println("用 " + language + " 说话");
    }

    public void eat() {
        String food = "banana";//局部变量没有默认值，需要初始化
        System.out.println("eating " + food);
    }
}